﻿using Furion;
using System;
using System.Collections.Generic;
using System.Security.Claims;

namespace HiSport.Core
{
    /// <summary>
    /// 当前用户
    /// </summary>
    public class CurrentUser
    {

        public static long UserId
        {
            get
            {
                var obj = App.User?.FindFirstValue("UserId");
                return string.IsNullOrWhiteSpace(obj) ? 0 : Convert.ToInt64(obj);
            }
        }

        public static long TenantId
        {
            get 
            {
                var obj = App.User?.FindFirstValue("TenantId");
                return string.IsNullOrWhiteSpace(obj) ? 0 : Convert.ToInt64(obj);
            }
        }

        public static string   Account => App.User?.FindFirstValue("Account");

        public static long OrgId { get; set; }

        public static long RoleId { get; set; }

    }
}
